import React from 'react';
import './index.less';

interface TableHint {
  type?: 'warning' | 'info' | 'danger';
  text?: React.ReactNode;
  showAction?: React.ReactNode;
  onAction?: () => void;
  onRefund?: () => void;
  actionText?: string;
}
const Index: React.FC<TableHint> = (props) => {
  const { type, text, showAction, onAction, onRefund, actionText } = props;
  return (
    <div className="table-hint">
      <div className={type}>{text}</div>
      <div className="actions">
        {showAction && <div onClick={onAction} className="action">{actionText || '点击查看'}</div>}
        {
          onRefund && <div onClick={onRefund} className="action">查看退款申请单</div>
        }
      </div>
    </div>
  );
};

export default Index;
